home *** CD-ROM | disk | FTP | other *** search
/ Rat Attack (UK) (Digital Press Kit - Summer '99) / Rat Attack (UK) (Digital Press Kit - Summer '99).bin / RAT01.DIR / 00138_Script_Random Sound < prev    next >
Text File  |  1999-04-26  |  2KB  |  75 lines

  1.  
  2. --  Random Sound Play Member
  3.  
  4. -- also functions through lingo by handling message 'initPlayMember', 
  5. -- for example if this behavior was assigned to sprite 5, use
  6. -- sendsprite 5, #initPlayMember
  7.  
  8. -- Media
  9. property WhichEvent, WhichSound, WhichChannel, StartImmediately
  10. property tester
  11.  
  12. on initPlayMember me
  13.   init me
  14. end
  15.  
  16.  
  17. on mouseUp me
  18.   if whichEvent = #mouseup    then init me
  19. end
  20.  
  21. on mouseDown me
  22.   if whichEvent = #mousedown  then init me
  23. end
  24.  
  25. on prepareFrame me
  26.   if whichEvent = #prepareframe then init me
  27. end
  28.  
  29. on enterFrame me
  30.   if whichEvent = #enterframe then init me
  31. end
  32.  
  33. on exitFrame me
  34.   if whichEvent = #exitframe  then init me
  35. end
  36.  
  37. on init me 
  38.   doSound
  39.   global mySound
  40.   puppetSound the WhichChannel of me, mySound -- the whichSound of me
  41.   if the StartImmediately of me then updatestage
  42. end
  43.  
  44. ---
  45.  
  46. on getPropertyDescriptionList
  47.   
  48.   set p_list = [ ¼
  49.           #WhichSound: [ #comment:   "Sound:", ¼
  50.                           #format:   #sound, ¼
  51.                          #default:   "clik" ], ¼
  52.         #WhichChannel: [ #comment:   "Channel:", ¼
  53.                           #format:   #integer, ¼
  54.                          #default:    1 ], ¼
  55.           #WhichEvent: [ #comment:   "Initializing Event:", ¼
  56.                           #format:   #symbol, ¼
  57.                            #range: [ #MouseUp, #MouseDown, #PrepareFrame, #EnterFrame, #ExitFrame, #InitPlayMember ], ¼
  58.                          #default:   #MouseDown ]¼
  59.                  ]
  60.   return p_list
  61.   
  62. end
  63.  
  64. on getBehaviorDescription
  65.   return ¼
  66. "Plays a random sound calling doSound in Movie Script when the specified event occurs, or when the message ." & RETURN & ¼
  67. "PARAMETERS:" & RETURN & ¼
  68. "ò Sound - Choose the sound cast member to be played."  & RETURN & ¼
  69. "ò Channel - Enter the sound channel number to be used for playback."  & RETURN & ¼
  70. "ò Initializing Event - Specify the event that triggers the behavior."
  71.   
  72. end
  73.  
  74.  
  75.